<?php
function index_submit($ord)
{
	include 'config.php';
	include_once 'lib/alipay_submit.class.php';

	//商户订单号，商户网站订单系统中唯一订单号，必填
	$out_trade_no = $ord['sn'];

	//订单名称，必填
	$subject = $ord['sn'];

	//付款金额，必填
	$total_fee = $ord['pay_money'];

	//构造要请求的参数数组，无需改动
	$parameter = array(
			"service"       => $alipay_config['service'],
			"partner"       => $alipay_config['partner'],
			"seller_id"     => $alipay_config['seller_id'],
			"payment_type"	=> $alipay_config['payment_type'],
			"notify_url"	=> $alipay_config['notify_url'],
			"return_url"	=> $alipay_config['return_url'],

			"anti_phishing_key"=>$alipay_config['anti_phishing_key'],
			"exter_invoke_ip"=>$alipay_config['exter_invoke_ip'],
			"out_trade_no"	=> $out_trade_no,
			"subject"	=> $subject,
			"total_fee"	=> $total_fee,
			"body"	=> '',
			"_input_charset"	=> trim(strtolower($alipay_config['input_charset']))
			//其他业务参数根据在线开发文档，添加参数.文档地址:https://doc.open.alipay.com/doc2/detail.htm?spm=a219a.7629140.0.0.kiX33I&treeId=62&articleId=103740&docType=1

	);

	//建立请求
	$alipaySubmit = new AlipaySubmit($alipay_config);
	echo $alipaySubmit->buildRequestForm($parameter, "post", "确认");
}

